import { componentSizes } from "element-plus";
import { createRouter, createWebHashHistory } from "vue-router";
import Home from '../components/HelloWorld.vue'
import About from "../components/About.vue"
import { navData } from "@/untils/nav";
const routes = [
    {
        path: '/',
        name: 'Home',
        component: Home
    },
    {
        path: '/about',
        name: 'About',
        component: About
    },

]

navData.forEach(element => {
    routes.push({
        path: element.path,
        name: element.name,
        component: () => import('../' + element.component)
    })
});
//创建路由
const router = createRouter(
    {
        history: createWebHashHistory(),
        routes
    }
)
export default router
//导出router